////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                                //
//                    Sequence list's find, insert, delete, etc...functions' implemention code               //
//                                                                                                                                //
//                                                                                                                                //
//                        Author:    Jack Hui (huiguobin)                                                               //
//                                                                                                                                //
//                                                                                                                                //
////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////Header File/////////////////////////////////////////////

#include <assert.h>
#include <stdlib.h>
#include <stdio.h>

typedef int DataType;

#define max_Size 100

/*Structure of Sequence List*/
typedef struct{
	DataType data[max_Size];
	int size;
}SeqList;

/*Print Sequence List function.*/
void print_seq(SeqList *L);


/*Sequence List's find function,
      SeqList L: a Sequence List;
      DataType key_data: the data value to find;
      int &pos:   when finding success, the position of the data in the sequence. */
int find_seq(SeqList L, DataType key_data, int *pos);


/*Sequence List's insert function,
       SeqList &L: a Sequence List;
       int pos:    position to insert;
       DataType insert_data: data to be insert.*/
int insert_seq(SeqList *L, int pos, DataType insert_data);


/* Sequence List's delete function,
      SeqList &L:  a Sequence List;
      int pos:       position to delete;
      DataType &del_data: data value to be delete.*/
int delete_seq(SeqList *L, int pos, DataType *del_data);

/* Sequence List's reverse function,
       SeqList &L: a Sequence List. */
int reverse_seq(SeqList *L);